package com.corpdata.controller;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.corpdata.activiti.entity.ProcessInfo;
import com.corpdata.common.base.BaseController;
import com.corpdata.common.result.DataTable;
import com.corpdata.entity.OrgUser;
import com.corpdata.service.OrgUserService;

@Controller()
@RequestMapping("/user")
public class OrgUserController extends BaseController {
	
	@Autowired
	private OrgUserService orgUserService;
	
	@GetMapping(value = "")
	public String list(Model model, HttpServletRequest request) {
		//model.addAttribute("url", request.getContextPath()+"/process/");
		return "sys/org/user/user_list";
	}
	
	@RequestMapping("/list")
	@ResponseBody
	public DataTable<OrgUser> getList(DataTable dt){
		if (null == dt) {
            return null;
        }
		//logger.info("ok");
		return orgUserService.getUserByPage(dt);
	}
	
	@RequestMapping("/get")
	@ResponseBody
	public Map<String,Object> get(){
		return orgUserService.get();
	}
		
}
